package com.wmh.baseservice.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;

/**
 * @author wmh generator
 * @since 2023-02-17
 */
@ApiModel(value="AdUserRole对象", description="")
public class AdUserRole implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "管理员id")
    private Long adId;

    @ApiModelProperty(value = "角色id")
    private Long roleId;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    public Long getId() {
        return id;
    }

    public AdUserRole setId(Long id) {
        this.id = id;
        return this;
    }
    public Long getAdId() {
        return adId;
    }

    public AdUserRole setAdId(Long adId) {
        this.adId = adId;
        return this;
    }
    public Long getRoleId() {
        return roleId;
    }

    public AdUserRole setRoleId(Long roleId) {
        this.roleId = roleId;
        return this;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public AdUserRole setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
        return this;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public AdUserRole setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public static final String ID = "id";

    public static final String AD_ID = "ad_id";

    public static final String ROLE_ID = "role_id";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    @Override
    public String toString() {
        return "AdUserRole{" +
            "id=" + id +
            ", adId=" + adId +
            ", roleId=" + roleId +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
        "}";
    }

    public final static String[] getFields(String ...noField){
        List<String> list = new ArrayList<>(Arrays.asList(
            AdUserRole.ID
            ,AdUserRole.AD_ID
            ,AdUserRole.ROLE_ID
            ,AdUserRole.CREATE_TIME
            ,AdUserRole.UPDATE_TIME
        ));
        list.removeAll(new ArrayList<>(Arrays.asList(noField)));
        return list.toArray(new String[0]);
    }
}